<template>
  <a-spin :spinning="confirmLoading">
  <a-card :bordered="false">
     <!-- 操作按钮区域 -->
    <div class="table-operator">
      <div class="ant-alert ant-alert-info" style="margin-bottom: 12px;margin-top:-10px; padding-left:20px;">
        <a style="margin-left: 20px" @click="openBillDlg"><a-icon type="snippets" />票据补开</a>
        <a style="margin-left: 20px" @click="voidBillDlg"><a-icon type="snippets" />票据补打</a>
        <a style="margin-left: 20px" @click="repeatBillDlg"><a-icon type="snippets" />票据重打</a>
        <a style="margin-left: 20px" @click="feeTotalTabPage"><a-icon type="snippets" />收费汇总</a>
        <a style="margin-left: 20px" @click="feeDetailTabPage "><a-icon type="snippets" />收费明细</a>
        <a style="margin-left: 20px" @click="billDetailTabPage "><a-icon type="snippets" />票据明细</a>
        <a style="margin-left: 20px" @click="deratefeeDlg"><a-icon type="snippets" />减免费用</a>
        <a style="margin-left: 20px" @click="deratePenaltyDlg"><a-icon type="snippets" />违约金减免</a>
        <!-- <a style="margin-left: 20px" @click="getArrearRowIds"><a-icon type="snippets" />欠费水量减免</a> -->
        <!-- <a style="margin-left: 20px" @click="getArrearRowIds"><a-icon type="snippets" />余额变动减免</a> -->
        <a style="margin-left: 20px">
          <template>
            <a-popconfirm
              title="您确定自动将所有预存用户扣款吗？"
              ok-text="确认"
              cancel-text="取消"
              @confirm="keyUniteFeeChanges"
              @cancel="cancelKeyUniteFee"
            >
              <a href="#"><a-icon type="snippets" />一键系统扣费</a>
            </a-popconfirm>
          </template>
          <!-- <template>
             <a-popconfirm title="您确定自动将所有预存用户扣款吗？" @confirm="() => keyUniteFeeChanges">
              <a><a-icon type="snippets" />一键系统扣费</a>
             </a-popconfirm>
            </template> -->
          </a>
      </div>
    </div>
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchFeeQuery" style="background-color:#0099CC;height:48px;border-radius: 3px;">
        <a-row :gutter="24">
          <a-col :xl="2" :lg="2" :md="2" :sm="24" style="text-align:right;margin-top: 8px;">
            <span style="color:#fff;font-size: 16px;">关键字：</span>
          </a-col>
          <a-col :xl="2" :lg="2" :md="2" :sm="24" style="text-align:left;color:#fff;">
            <a-form-item label="" style="margin-bottom:0px;margin-top: 6px;padding-left:8px;">
              <a-input placeholder="户号" style="height:26px; width:120px;margin-left:-30px;" v-model="queryParam.accCode"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="1" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;margin-bottom:0px;margin-top: 8px;text-align:right;" class="table-page-search-submitButtons">
              <a style="color:#fff;font-size: 18px;" @click="searchFeeQuery"><a-icon type="search" /> 查询  </a>   
            </span>
          </a-col>
           <a-col :xl="3" :lg="7" :md="8" :sm="24">   
            <j-popup style="color:#fff;font-size: 18px; margin-left:10px;margin-top:8px;"
                v-model="queryParam.acc_name"
                field="acc_name"
                org-fields="acc_code,acc_name"
                dest-fields="accCode,acc_name"
                code="arc_pay_account"
                :multi="false"
                @input="popupCallback"
                />        
           </a-col>
          <a-col :xl="3" :lg="2" :md="2" :sm="24" style="text-align:left;color:#fff;">
            <a-form-item label="姓名" style="margin-bottom:0px;margin-top: 8px;padding-left:8px;">
              <span style="color:#FFF;font-size: 16px;">{{ accInfo.accName }} </span>
            </a-form-item>
          </a-col>
          <a-col :xl="3" :lg="2" :md="2" :sm="24" style="text-align:left;color:#fff;">
            <a-form-item label="手机" style="margin-bottom:0px;margin-top: 8px;padding-left:8px;">
              <span style="color:#FFF;font-size: 16px;">{{ accInfo.accPhone }} </span>
            </a-form-item>
          </a-col>
          <a-col :xl="2" :lg="2" :md="2" :sm="24" style="text-align:left;color:#fff;">
            <a-form-item label="预存余额" style="margin-bottom:0px;margin-top: 8px;padding-left:0px;">
              <span style="color:#fc0606;font-size: 16px;padding-left:2px;">{{ accInfo.accBalance }} </span>
            </a-form-item>
          </a-col>
          <a-col :xl="4" :lg="2" :md="2" :sm="24" style="text-align:left;color:#fff;">
            <a-form-item label="退费金额" style="margin-bottom:0px;margin-top: 8px;padding-left:8px;">
              <a-input  style="height:26px; width:120px;margin-left:-10px;color:#fc0606" v-model="accInfo.reFee"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="2" :lg="2" :md="2" :sm="24" style="text-align:left;color:#fff;">
             <span style="float: left;overflow: hidden;margin-bottom:0px;margin-top: 8px;text-align:left;" class="table-page-search-submitButtons">
              <a style="color:#fff;font-size: 18px;" @click="handleReturnFee"><a-icon type="pay-circle" /> 退费  </a>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- 收费区域 -->
    <template>
      <div class="feesInfo">
        <chg-unite-fees-form ref="realForm" @feeChanges="feeChanges" @handleFeeCharge="handleFeeCharge" />
      </div>
    </template>
     <!-- 收费区域 -END-->

    <!-- 票据补开-补开区域 ChgPayfeeModal-->
    <template>
      <div class="billOpenInfo">
        <chg-payfee-modal ref="billOpenForm" @handleOpenBill="handleOpenBill" />
      </div>
    </template>
     <!-- 票据补开区域 -END-->

    <!-- 票据补打-原票据作废 区域 ChgPrintVoidModal-->
    <template>
      <div class="billVoidInfo">
        <chg-print-void-modal ref="billVoidForm" @handleVoidBill="handleVoidBill" />
      </div>
    </template>
     <!-- 票据补打区域 -END-->

    <!-- 票据重打-区域 ChgPrintVoidModal-->
    <template>
      <div class="billRepeatInfo">
        <chg-print-repeat-modal ref="billRepeatForm" @handleRepeatBill="handleRepeatBill" />
      </div>
    </template>
     <!-- 票据重打区域 -END-->

    <!-- 票据区域 -->
    <template>
      <div class="billInfo">
        <chg-fee-bill-modal ref="modalBillForm" v-bind:printBillData="printBillData" @modalBillFormOk="modalBillFormOk" @modalBillCancel="modalBillCancel"/>
      </div>
    </template>
     <!-- 票据区域 -END-->

    <!-- 减免费用 区域 ChgPrintVoidModal-->
    <template>
      <div class="derateFeeInfo">
        <chg-deratefee-modal ref="derateFeeForm" @handleDeratefee="handleDeratefee" />
      </div>
    </template>
     <!-- 减免费用区域 -END-->

    <!-- 减免违约金 区域 ChgPrintVoidModal-->
    <template>
      <div class="deratePenaltyInfo">
        <chg-deratepat-modal ref="deratepatForm" @handleDeratepat="handleDeratepat" />
      </div>
    </template>
     <!-- 减免费用区域 -END-->

    <!-- table区域-begin -->
    <div>
      <a-tabs defaultActiveKey="1" style="margin:0px;">
        <a-tab-pane tab="水表用户" key="1" >
          <ChgUniteFeesUser ref="userChild"   />
        </a-tab-pane>
      </a-tabs>

       <a-tabs defaultActiveKey="1">
        <a-tab-pane tab="费用信息" key="1" >
          <chg-unite-fees-arrear  ref="arrearChild" @feeSelectChanges="feeSelectChanges" ></chg-unite-fees-arrear>
        </a-tab-pane>
      </a-tabs>
    </div>
  </a-card>
  </a-spin>
</template>

<script>

  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { getAction,postAction} from '@/api/manage'
  import ChgUniteFeesUser from './ChgUniteFeesUser'
  import ChgUniteFeesArrear from './ChgUniteFeesArrear'
  import ChgUniteFeesForm from './modules/ChgUniteFeesForm'
  import ChgFeeBillModal from './modules/printBill/ChgFeeBillModal'
  import ChgPayfeeModal from './modules/printOpen/ChgPayfeeModal'
  import ChgPrintVoidModal from './modules/printVoid/ChgPrintVoidModal'
  import ChgDeratefeeModal from './modules/derateFee/ChgDeratefeeModal'
  import ChgDeratepatModal from './modules/derateFee/ChgDeratepatModal'
  import ChgPrintRepeatModal from './modules/printRepeat/ChgPrintRepeatModal'

  import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  import '@/assets/less/TableExpand.less'


  export default {
    name: "ChgUniteFees",
    mixins:[JeecgListMixin],
    components: {
      ChgUniteFeesUser ,
      ChgUniteFeesArrear,
      ChgUniteFeesForm,
      ChgFeeBillModal,
      ChgPayfeeModal,
      ChgPayfeeModal,
      ChgPrintVoidModal,
      ChgDeratefeeModal,
      ChgDeratepatModal,
      ChgPrintRepeatModal
    },
    data () {
      return {
        description: '统一收费管理页面',
        confirmLoading:false,
        selectedMainId:'',
        accInfo:{
          id: '',
          accName:'',
          accPhone:'',
          accBalance:0,
          reFee:0,
          arrearMoney:0
        },
         // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'用户号',
            align:"center",
            dataIndex: 'code'
          },
          {
            title:'用户名',
            align:"center",
            dataIndex: 'name'
          },
          {
            title:'地址',
            align:"center",
            dataIndex: 'address'
          },
          {
            title:'用水性质',
            align:"center",
            dataIndex: 'natureName'
          }
        ],
        url: {
          list: "/chg/chgArrears/feesList",
          charge: "/chg/chgFees/chargeFee",
          keyUniteUrl: "/chg/chgFees/keyUniteCharge",
          returnCharge: "/chg/chgFees/returnFee",
          printBillUrl: "/chg/chgFees/printBillData",
          printSubmit: "/chg/chgFees/printBillSubmit",
          printVoidUrl: "/chg/chgFees/printVoidBill",
          printRepeatUrl: "/chg/chgFees/printRepeatBill",
          deratefeeUrl: "/chg/chgFees/deratefee",
          deratePatUrl: "/chg/chgFees/deratePenalty",
        },
        dictOptions:{},
        dataSource:[],
        printBillList: [],
        printIndex: 0,
        printBillData: [],

      }
    },
    created() {
      this.queryParam.code='012019';
      // this.loadData();
    },
    computed: {

    },
    methods: {
       loadData(){

      },

      initDictConfig(){
      },
      submitCallback(){

      },
      searchFeeQuery(){
        var params = this.getQueryParams();//查询条件
        this.loading = true;
        this.resetQuery();

        if(params && (params.id || params.accCode) ){
          getAction(this.url.list, params).then((res) => {
            if (res.success) {
              this.loadUserData(res.result.userInfo);
              this.loadArrearData(res.result.feesInfo);
              this.accInfo=res.result.accInfo;
              this.accInfo.arrearMoney= res.result.arrearMoney;

              setTimeout(()=>{
                 //默认全勾选欠费
                this.feeChanges();
              },300)             
            }else{
                this.$message.warning(res.message)
            }
          }).finally(() => {
            this.loading = false
          })
        }else{
          this.resetQuery();

        }
      },
      resetQuery(){
        this.printIndex= 0;
        this.printBillData=[];
        this.loadUserData(null);
        this.loadArrearData(null);
        this.$refs.realForm.setFeeModel(null);
        this.accInfo.id='';
        this.accInfo.accBalance=0;
        this.accInfo.reFee=0;
      },

      //根据勾选更新应收金额
      feeSelectChanges(){
        let selArrearMoney= this.$refs.arrearChild.getSelectDataRowFees(); 
        this.$refs.realForm.setFeeModelMoney(selArrearMoney);
      },

      //变化重新计费
      feeChanges(){
        let realMode= this.$refs.realForm.getFeeModel();
        let feeTollWay=realMode.feeTollWay;
        let feeWholeWay=realMode.feeWholeWay;
        let billTypeId=realMode.billTypeId;
        let feePrintWay=realMode.feePrintWay;
        let payFee=realMode.payFee;
        let zeroFee=realMode.zeroFee;

        //应收
        let arrearMoney = realMode.receFee >0 ? realMode.receFee : this.accInfo.arrearMoney ;

        if(arrearMoney >0){
          //应收
          realMode.receFee=arrearMoney;

          //实缴= 应收（欠费金额）-预存余额
          // let realNum = this.accInfo.arrearMoney-this.accInfo.accBalance;
          let realNum = arrearMoney - this.accInfo.accBalance;
          realNum = realNum.toFixed(2); // 输出结果为 2.45
          if(realNum<0){
            realNum=0.0;
          }
          let realFee= realNum;//实缴

          //是否有付款额
          if( realMode.payFee ){

            //全额收取、余额预存
            if( realMode.feeTollWay == '01'){

              //实收、不扣余额实收
              if( realMode.feeWholeWay == '01'){
                  realMode.realFee=realFee;
              }else  if( realMode.feeWholeWay == '02'){
                //不扣
                realNum=arrearMoney; //this.accInfo.arrearMoney;               
                realMode.realFee= realNum.toFixed(2);
              }
              let zoreNum =realMode.payFee-realMode.realFee;
              zoreNum = zoreNum.toFixed(2); // 输出结果为 2.45
              realMode.zeroFee= zoreNum;

            }else{

               //实收、不扣余额实收
              if( realMode.feeWholeWay == '01'){
                  realMode.realFee=realFee;
              }else  if( realMode.feeWholeWay == '02'){
                //不扣
                realMode.realFee=arrearMoney; //this.accInfo.arrearMoney;
              }

              realMode.zeroFee= 0;
            }

          }else{
             //全额收取、余额预存
            if( realMode.feeTollWay == '01'){

              //实收、不扣余额实收
              if( realMode.feeWholeWay == '01'){
                  realMode.realFee=realFee;
              }else  if( realMode.feeWholeWay == '02'){
                //不扣
                realNum=arrearMoney; // this.accInfo.arrearMoney;                
                realMode.realFee= realNum.toFixed(2);
              }
            }else{
               //实收、不扣余额实收
              if( realMode.feeWholeWay == '01'){
                  realMode.realFee=realFee;
              }else  if( realMode.feeWholeWay == '02'){
                //不扣
                realNum=arrearMoney;//this.accInfo.arrearMoney;                
                realMode.realFee= realNum.toFixed(2);;
              }
            }
          }
          this.$refs.realForm.setFeeModel(realMode);
        }
      },
      handleFeeCharge(){
        let feeModel= this.$refs.realForm.getFeeModel();
        /** 1.先收费
         *  2.打印方式feePrintWay
         *  3.是否多水表用户 this.getUserData()
         * 应收 receFee 付款payFee feePayWay
         *  rsObject.put("paymentId",chgPayments.getId());
		        rsObject.put("feeIds",feeIds);
		        rsObject.put("id",arcAccount.getId());
         */

        let arrearIds=this.getArrearRowIds();
        feeModel.arrearIds=arrearIds;
        feeModel.id= this.accInfo.id;
        feeModel.accCode=this.accInfo.accCode;
        feeModel.accName=this.accInfo.accName;

      if( this.accInfo.id && (feeModel.receFee>0 || feeModel.payFee>0)){

          this.confirmLoading = true;
          postAction(this.url.charge, feeModel).then((res) => {            
            if (res.success) {
              if(res.result.isPrintBill == 1){
                this.$message.success("缴费成功,准备打印...");            
                this.printBill(feeModel.billTypeId,feeModel.feePrintWay,res.result.paymentId,res.result.accountId,null);
              }else{
                this.$message.success("缴费成功");
              }
              this.resetQuery();
            }else{
                this.$message.warning(res.message)
            }
          }).finally(() => {
            this.confirmLoading = false
          })

          // let res={"success":true,"message":"","code":200
          //   ,"result":{"accountId":"1494954584383148034","paymentId":"1506637242146742273"},"timestamp":1648045285290}
          //   if (res.success) {
          //     this.printBill(feeModel.billTypeId,feeModel.feePrintWay,res.result.paymentId,res.result.userFee,res.result.accountId);
          //   }else{
          //       this.$message.warning(res.message)
          //   }
        }

      },
      //补开
      handleOpenBill(){
        let billParam= this.$refs.billOpenForm.getBillParam();
        if(billParam.payId && billParam.payId.length>0){
          //收据
          this.printBillType1(billParam.billTypeId,billParam.feePrintWay,billParam.payId[0],null,billParam.accCode);
        }
      },

      //补打-原票据作废
      handleVoidBill(){
        let billParam= this.$refs.billVoidForm.getBillParam();
        if(billParam.voucherId && billParam.voucherId.length>0){
          this.printVoidBill(billParam.voucherId[0],billParam.accCode);
        }
        console.log("open-void-bill",billParam);
      },
      //重打-
      handleRepeatBill(){
        let billParam= this.$refs.billRepeatForm.getBillParam();
        if(billParam.voucherId && billParam.voucherId.length>0){
          this.printRepeatBill(billParam.voucherId[0],billParam.accCode);
        }
        console.log("open-void-bill",billParam);
      },
      //减免费用
      handleDeratefee(){
        let billParam= this.$refs.derateFeeForm.getBillParam();
        console.log("billParam:",billParam);

        if( billParam.arrearRow && billParam.arrearRow.length>0){
          let row=billParam.arrearRow[0];
          //提交后台已打
          let param={
            subArrearId: row.id,
            arrearId: row.arrearId,
            feeStrikeCause: billParam.feeStrikeCause,
            money: billParam.money,
            responMan: billParam.responMan,
            remark: billParam.remark,
            expenseId: row.expenseId,
            subExpenseId: row.subExpenseId
          }
          postAction(this.url.deratefeeUrl, param).then((res) => {
            if (res.success) {
             this.$message.success(res.message);
             this.searchFeeQuery();
            }else{
              this.$message.warning(res.message)
            }
          }).finally(() => {
            this.loading = false
          })
        }
      },
       //减免费用-违约金
      handleDeratepat(){
        let billParam= this.$refs.deratepatForm.getBillParam();
        console.log("billParam:",billParam);
        if( billParam.arrearRow && billParam.arrearRow.length>0){
          let row=billParam.arrearRow[0];

          this.confirmLoading = true;
          //提交后台已打
          let param={
            arrearId: row.id,
            feeStrikeCause: billParam.feeStrikeCause,
            money: billParam.money,
            responMan: billParam.responMan,
            remark: billParam.remark
          }
          postAction(this.url.deratePatUrl, param).then((res) => {
            if (res.success) {
             this.$message.success(res.message);
             this.searchFeeQuery();
            }else{
              this.$message.warning(res.message)
            }
          }).finally(() => {
            this.confirmLoading = false
          })
        }
      },

      //退费
      handleReturnFee(){
        let feeModel= this.accInfo;
        /**
         */
        if(this.accInfo.id && this.accInfo.reFee>0 ){
          this.confirmLoading = true;
          postAction(this.url.returnCharge, feeModel).then((res) => {
            if (res.success) {
               this.$message.success(res.message)
               this.searchFeeQuery();
            }else{
                this.$message.warning(res.message)
            }
          }).finally(() => {
            this.confirmLoading = false
          })
        }
      },
       /**
        每户合票	01
        * 每户每月	02
        * 每表合票	03
        * 每表每月	04
        * 分票	06
        * 预开票	07
        * 预存退款	08
        * 预存发票	09
        * 收费预存收据	10
        */
      printBill(billTypeId,feePrintWay,paymentId,accountId,accCode){

        if(billTypeId === '01'){
          //收据
           this.printBillType1(billTypeId,feePrintWay,paymentId,accountId,accCode);
        }else{
          //发票
           this.printBillType2(billTypeId,feePrintWay,paymentId,accountId,accCode);
        }

      },
      //打印确认
      modalBillFormOk(){
        //PDF 后台直接打印 无需票据弹框 确认
        //票据弹窗 OK 返回
        console.log("票据弹窗 OK 返回");

        let currPrintData=this.printBillList[this.printIndex];

        //提交后台已打
        let param={
          accountId: currPrintData.accountId,
          billId: currPrintData.billId,
          paymentId: currPrintData.paymentId,
          isPrint: true,
          isNew: currPrintData.isNew,
          printIndex: this.printIndex,
          billTypeId: currPrintData.billTypeId,
          feePrintWay: currPrintData.feePrintWay
        }
        this.confirmLoading = true;
        postAction(this.url.printSubmit, param).then((res) => {

          if (res.success) {
            this.printIndex= this.printIndex+1;
            this.continuePrint();
            // setTimeout(()=>{
            //   if(this.printBillList.length>this.printIndex){
            //     this.$refs.modalBillForm.handleOk();
            //   }
            // },100)
          }else{
              this.$message.warning(res.message)
          }
        }).finally(() => {
          this.confirmLoading = false
        })
      },
      modalBillCancel(){
        //PDF 后台直接打印 无需票据弹框 取消

        //票据弹窗 OK 返回
        console.log("票据弹窗 close 返回");

        let currPrintData=this.printBillList[this.printIndex];

        //提交后台已打
        let param={
          accountId: currPrintData.accountId,
          billId: currPrintData.billId,
          isPrint: false,
          isNew: currPrintData.isNew,
          billTypeId: currPrintData.billTypeId
        }
        this.confirmLoading = true;
        postAction(this.url.printSubmit, param).then((res) => {
          if (res.success) {
            console.log("cancel print");
            // this.printIndex= this.printIndex+1;
            // this.continuePrint();
            //取消就全部取消
            this.printIndex=0;
            this.printBillData=[];
          }else{
            this.$message.warning(res.message)
          }
        }).finally(() => {
          this.confirmLoading = false
        })

      },
      continuePrint(){
        //PDF 后台直接打印 包括多页

        if(this.printBillList.length>this.printIndex){
          this.printBillData=this.printBillList[this.printIndex];
          //继续打印测试
          this.openBillForm1();
        }else{
          this.printIndex=0;
          this.printBillData=[];
        }

      },
      //票据作废
      printVoidBill(voucherId,accCode){
        let param={
          id: voucherId
        }
        this.confirmLoading = true;
        postAction(this.url.printVoidUrl, param).then((res) => {
          if (res.success) {
            let billVo=res.result;
            //作废成功继续重新打印同类型的票据
            this.printBill(billVo.billTypeId,billVo.feePrintWay,billVo.paymentId,null,accCode);
          }else{
              this.$message.warning(res.message)
          }
        }).finally(() => {
          this.confirmLoading = false
        })
      },
       //票据重打
      printRepeatBill(voucherId,accCode){
        let param={
          id: voucherId,
          accCode: accCode
        }
        this.confirmLoading = true;
        postAction(this.url.printRepeatUrl, param).then((res) => {
          if (res.success) {
            //走-后台直接打印
            // this.$message.success(res.message);
            // //获取原票据数据
            this.printBillList=res.result;
            this.continuePrint();
          }else{
              this.$message.warning(res.message)
          }
        }).finally(() => {
          this.confirmLoading = false
        })
      },
      //收据-后台直接打印
      printBillType1(billTypeId,feePrintWay,paymentId,accountId,accCode){
        let param={
          accountId: accountId,
          accCode: accCode,
          billTypeId: billTypeId,
          feePrintWay: feePrintWay,
          paymentId: paymentId
        }
        this.confirmLoading = true;
        postAction(this.url.printBillUrl, param).then((res) => {
          if (res.success) {
            //  this.$message.success(res.message);
            //走-后台直接打印(仅在服务器端)           
            this.printBillList=res.result;
            this.continuePrint();
          }else{
              this.$message.warning(res.message)
          }
        }).finally(() => {
          this.confirmLoading = false
        })
      },
      printBillType2(billTypeId,feePrintWay,paymentId,accountId,accCode){
        //发票
        this.confirmLoading = true;
        postAction(this.url.printBillUrl, feeModel).then((res) => {
          if (res.success) {
              this.printBillData=res.result
              //打印测试
              this.openBillForm2();
          }else{
              this.$message.warning(res.message)
          }
        }).finally(() => {
          this.confirmLoading = false
        })

      },
      openBillForm1(){
        this.$refs.modalBillForm.add();
        this.$refs.modalBillForm.title = "收据打印";
        this.$refs.modalBillForm.disableSubmit = false;
      },
      openBillForm2(){
        this.$refs.modalBillForm.add();
        this.$refs.modalBillForm.title = "发票打印";
        this.$refs.modalBillForm.disableSubmit = false;
      },
      openBillDlg(){
        this.$refs.billOpenForm.add();
        this.$refs.billOpenForm.title = "票据补开（未开票）";
        this.$refs.billOpenForm.disableSubmit = false;
      },
      voidBillDlg(){
        this.$refs.billVoidForm.add();
        this.$refs.billVoidForm.title = "票据补打（原票据作废）";
        this.$refs.billVoidForm.disableSubmit = false;
      },
      repeatBillDlg(){
        this.$refs.billRepeatForm.add();
        this.$refs.billRepeatForm.title = "票据重打（原票据）";
        this.$refs.billRepeatForm.disableSubmit = false;
      },
      feeTotalTabPage(){
        this.$router.push({path: '/fees/ba64590e42f0ab1b7cea87ab024ff4c4'})
      },
      feeDetailTabPage(){
        this.$router.push({path: '/fees/811ddb10c81a14eb6bf870449a2da803'})
      },
      billDetailTabPage(){
        this.$router.push({path: 'fees/bef1cd51ac99c308af770e87df1b26fe'})
      },
      deratefeeDlg(){
        this.$refs.derateFeeForm.add();
        this.$refs.derateFeeForm.title = "减免费用";
        this.$refs.derateFeeForm.disableSubmit = false;
      },
      deratePenaltyDlg(){
        this.$refs.deratepatForm.add();
        this.$refs.deratepatForm.title = "减免违约金";
        this.$refs.deratepatForm.disableSubmit = false;
      },
      keyUniteFeeChanges(){
        let param={
        }
         this.confirmLoading = true;
        postAction(this.url.keyUniteUrl, param).then((res) => {
          if (res.success) {
           this.$message.success(res.message);
          }else{
              this.$message.warning(res.message)
          }
        }).finally(() => {
          this.confirmLoading = false
        })
      },
      cancelKeyUniteFee(){

      },
      loadUserData(data){
          this.$refs.userChild.loadUserData(data);
      },
      loadArrearData(data){
          this.$refs.arrearChild.loadArrearData(data);
      },
      getArrearRowIds(){
         return this.$refs.arrearChild.getSelectDataRowIds();
      },
      getUserData(){
         return this.$refs.userChild.getUserData();
      },
      popupCallback(value,row){
        this.queryParam = Object.assign(this.queryParam, row);
      },
      searchFeeReset(){

      }

    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
  .feeInput{
    width: 100px;
  }
  .feesInfo{
    margin-top: 10px;
    border: 5px solid rgb(0, 153, 204);
    border-radius: 4px;
  }
  .ant-tabs-bar .ant-tabs-top-bar{
    margin: 0px;
    border-bottom: 1px solid #e8e8e8;
    outline: none;
    transition: padding 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  }
  .ant-input {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-variant: tabular-nums;
    list-style: none;
    font-feature-settings: 'tnum';
    position: relative;
    display: inline-block;
    width: 100%;
    height: 28px;
    padding: 4px 11px;
    color: rgba(0, 0, 0, 0.65);
    font-size: 14px;
    line-height: 1.5;
    background-color: #fff;
    background-image: none;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    transition: all 0.3s;
  }

</style>